/***************************************************************************
 *   Copyright (C) 2005 by xihe   *
 *   xihels@163.com                                                        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef _CHANG_STATUS_H_
#define _CHANG_STATUS_H_

#include "Packet.h"
/**
 * 改变状态的包，格式为
 * 1. 头部
 * 2. 想要切换到的状态，一个字节
 * 3. 是否显示虚拟摄像头，4字节
 * 4. 尾部
 */

class ChangeStatusPacket : public OutPacket {
    public:
	ChangeStatusPacket(QQClient& client,
		uint8_t status_) :
	    OutPacket(client,
		    QQ_CMD_CHANGE_STATUS,
		    SEND_COUNT),
	    status(status_)
	{}
	int putBody(uint8_t* buf) const;
    private:
	uint8_t status;
};


/**
 * 这个是用户自己改变在线状态的应答包，格式是
 * 1. 头部
 * 2. 一个字节的应答码，0x30表示成功，定义在QQ接口中
 * 3. 尾部
 */

class ChangeStatusReplyPacket : public InPacket {
    protected:
	ChangeStatusReplyPacket(const uint8_t* buf, int len) :
	    InPacket(buf, len, true),
	    replyCode(*(buf + QQ_HEADER_LENGTH_BASIC_FAMILY_IN))
	{}
    public:
	uint8_t getReplyCode() const { return replyCode; }
    private:
	uint8_t replyCode;
};

#endif // _CHANG_STATUS_H_

